import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author Buddy
 * @date 2021/5/6
 */
public class Main2 {

    public static void main(String[] args) {
        String s = "aeiouAEIOU";
        Scanner in = new Scanner(System.in);
        try {
            Integer flaw = Integer.parseInt(in.nextLine());
            String str = in.nextLine();
            // 上一个字符是否为元音
            boolean pre = true;
            List<String> y = new ArrayList<>();
            List<String> n = new ArrayList<>();
            StringBuffer ysb = new StringBuffer();
            StringBuffer nsb = new StringBuffer();
            for (int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                int index = s.indexOf(c);
                if (-1 == index) {
                    //说明不是元音
                    if (pre) {
                        // 上一个是元音
                        if (ysb.length() > 0) {
                            y.add(ysb.toString());
                            n.add("");
                            ysb = new StringBuffer();
                        }
                    }
                    // 上一个也不是元音
                    nsb.append(c);
                    pre = false;
                } else {
                    //说明是元音
                    if (!pre) {
                        // 上一个不是元音
                        if (nsb.length() > 0) {
                            n.add(nsb.toString());
                            y.add("");
                            nsb = new StringBuffer();
                        }
                    }
                    // 上一个也是元音
                    ysb.append(c);
                    pre = true;
                }
            }
            if (ysb.length() > 0) {
                y.add(ysb.toString());
                n.add("");
            }
            if (nsb.length() > 0) {
                n.add(nsb.toString());
                y.add("");
            }
            int maxLength = 0;
            if (flaw == 0) {
                for (String s1 : y) {
                    int length = s1.length();
                    maxLength = maxLength > length ? maxLength : length;
                }
            } else {
                List<Integer> iList = new ArrayList<>();
                for (int i = 0; i < n.size(); i++) {
                    String ns = n.get(i);
                    if (ns.length() == flaw) {
                        iList.add(i);
                    }
                }
                for (Integer anIList : iList) {
                    int i = anIList;
                    if (i - 1 < 0 || i + 1 > y.size() - 1 || y.get(i - 1).length() == 0 || y.get(i + 1).length() == 0) {
                        continue;
                    }
                    int length = y.get(i - 1).length() + n.get(i).length() + y.get(i + 1).length();
                    maxLength = maxLength > length ? maxLength : length;
                }
            }
            System.out.println(maxLength);
        } catch (Exception e) {
            System.out.println(0);
        }
    }
}
